ISO 13818-2 has been known as one of the standards relating to compression/encoding techniques for multimedia information which are generally called as MPEG-2 (Moving Picture Experts Group Phase 2). A video stream of MPEG-2 has a hierarchical structure which includes a sequence layer, a GOP (Group of Pictures) layer, a picture layer, a slice layer, a macroblock layer, and a block layer in this order from the uppermost layer. Each layer has a special pattern of 4-byte length called a start code at the leading end thereof. This start code starts with three bytes of 0x00, 0x00, and 0x01, and the following one byte indicates the type of data subsequent to the start code. In this specification, “0x” means hexadecimal representation. For example, the fourth bytes of the start codes of the sequence layer, the GOP layer, the picture layer, and the slice layer are 0xB3, 0xB8, 0x00, and 0xAF, respectively.
In MPEG-2, setting of a user extension area is allowed in each of the sequence layer, the GOP layer, and the picture layer. Although it is prescribed that the start code of user data is formed by four bytes of 0x00, 0x00, 0x01, and 0xB2, user data of an arbitrary format determined based on unique user extension can be placed in any user extension area.
Actually, in each of digital storage media, such as a DVD (Digital Versatile Disk), and the like, and digital broadcasting, such as DVB (Digital Video Broadcasting), and the like, unique user extension is realized in compliance with MPEG-2. That fact is that, for example, the standards of user data for closed caption are not unified, and format conversion between user data is necessary.
A realtime encoding technique for storing text information, such as English subtitle information, or the like, in a GOP header as user data has been known (see Japanese Laid-Open Patent Publication No. 2001-145067).
A bit rate converter (transcoder) with which the process amount in conversion between TSs (Transport Streams) can be reduced has been proposed (see Japanese Laid-Open Patent Publication No. 2001-251616).
As a matter of course, the simplest method for converting the format of user data is to connect a decoder of a system and an encoder of another system. However, unnecessary processes are performed on data other than the user data, i.e., main data, and can be a cause of deterioration in image quality.
Nevertheless, if only the format of user data included in an input code is simply converted to obtain an output code, the data amount greatly changes because of the conversion. Accordingly, there is a possibility that rate control fails. As parameters for determining the allowable range of data amount, a bit rate value and a VBV (Video Buffering Verifier) buffer size value are included in a sequence header, and a VBV delay value is included in a picture header. There is a possibility that rate control based on these parameters fails. The same applies to a case where user data is added to an input code to generate an output code.